<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@include file="/WEB-INF/inc.jsp" %>
<!DOCTYPE>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>成都文理学院思想政治理论水平在线测试</title>
    <link rel="shortcut icon" href="<%=contextPath%>/images/favicon.ico">
    <link href="<%=contextPath%>/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet"
          type="text/css"/>
    <link href="<%=contextPath%>/assets/bootstrap/css/theme.css" rel="stylesheet"
          type="text/css"/>
    <script src="<%=contextPath%>/js/jquery-1.11.3.min.js"></script>
    <script src="<%=contextPath%>/assets/bootstrap/js/bootstrap.min.js" rel="stylesheet"
            media="screen"></script>
</head>
<body>
<div align="center" style="background-color: white;">
    <img src="<%=contextPath%>/images/logo.png"/>

</div>
<div style="font-size:31px;color:red;font-family:宋体;text-align:center;margin-top:10px;margin-bottom:-8px;">
    <b>${user_in_session.examName}</b></div>
<div class="row-fluid">
    <div class="container-fluid">
        <div class="span12 examcontent">
            <div class="exambox">
                <div class="examform">
                    <div class="container-fluid footcontent">
                        <fieldset>
                            <legend><font color="red" size="5">考生个人信息</font>&nbsp&nbsp<a href="<%=contextPath%>/logout"
                                                                                         style="cursor:pointer; position:static; margin-right: 10px;font-size: 18px;">退出登录</a>
                            </legend>
                            <div class="row-fluid">
                                <div class="span6">
                                    <b>学号：</b>${user_in_session.studentNo}
                                </div>
                                <div class="span6">
                                    <b>性别：</b> ${user_in_session.sex}
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <b>姓名：</b> ${user_in_session.name}
                                </div>
                                <div class="span6">
                                    <b>班级：</b>${user_in_session.clazz}
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <b>年级：</b>${user_in_session.grade}
                                </div>
                                <div class="span6">
                                    <b>专业：</b>${user_in_session.major}
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">

                                    <b>登陆时间：</b><fmt:formatDate value="${user_in_session.lastLoginTime}"
                                                                pattern="yyyy-MM-dd HH:mm:ss"/>
                                </div>
                                <div class="span6">
                                    <b>登陆IP：</b> ${user_in_session.lastLoginIp}
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <b>是否毕业：</b>${user_in_session.graduated}
                                </div>
                                <div class="span6">
                                    <b>优秀学员：</b>${user_in_session.excellent}
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <b>备注：</b>${user_in_session.excellent}
                                </div>
                            </div>
                        </fieldset>

                        <br/>
                        <fieldset>
                            <legend><font color="red" size="5">考生个人成绩</font></legend>
                            <div class="row-fluid">
                                <div class="span12">
                                    <b>初考考试：</b>
                                    <c:if test="${user_in_session.examState==0}">
                                        <font color="red">初试考试暂未进行，暂时还没有初试成绩</font>
                                    </c:if>
                                    <c:if test="${user_in_session.examState==1}">
                                        初试考试正在进行
                                    </c:if>
                                    <c:if test="${user_in_session.examState==2}">
                                        初试考试合格,成绩：${user_in_session.examScore }分
                                    </c:if>
                                    <c:if test="${user_in_session.examState==3}">
                                        <font color="red">初试考试未通过，成绩：${user_in_session.examScore }分</font>
                                    </c:if>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <b>补考考试：</b>
                                    <c:if test="${user_in_session.makeUpState==0}">
                                        <font color="red">补考考试暂未进行，暂时还没有补考成绩</font>
                                    </c:if>
                                    <c:if test="${user_in_session.makeUpState==1}">
                                        补考考试正在进行
                                    </c:if>
                                    <c:if test="${user_in_session.makeUpState==2}">
                                        补考考试合格，成绩：${user_in_session.makeUpScore }分
                                    </c:if>
                                    <c:if test="${user_in_session.makeUpState==3}">
                                        <font color="red">补考考试未通过，成绩：${user_in_session.makeUpScore }分</font>
                                    </c:if>
                                </div>
                            </div>
                        </fieldset>
                        <br/>

                        <fieldset>
                            <legend><font color="red" size="5">考试须知</font></legend>
                            <div class="row-fluid">
                                <div class="span12">
                                    <b>1.考试时间：${EXAMTIME_IN_SESSION}分钟。<br/>
                                        2.考试题型：单选题（${questionNum.danxuanScore}分*${questionNum.danxuanNum}题）、多选题（${questionNum.duoxuanScore}分*${questionNum.duoxuanNum}题）、判断题
                                        （${questionNum.panduanScore}分*${questionNum.panduanNum}题），及格线（${user_in_session.pass}分）。<br/>3.中途退出考试的作为放弃考试处理。考试完成后确认交卷成功后，即可看到考试成绩。<br/>4.提前交卷未成功
                                        的，请等待考试时间结束，系统自动交卷，并不要连续点击交卷按钮。<br/>以上事项有不清楚的地方和网上考试期间登录有问题，
                                        请与监考老师联系。</b><br/> <br/>
                                </div>
                            </div>
                            <form action="<%=contextPath%>/exam" method="post">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <div class="row-fluid">
                                    <div class="span12">

                                        <input id="CheckBox" type="checkbox" name="agree" value="1"/> 已阅读考试须知，同意遵守各项条款

                                    </div>
                                </div>
                                <br/> <br/>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <Button id="examButtion" disabled="disabled" type="submit" class="btn">参加考试
                                        </Button>
                                    </div>
                                    <c:if test="${user_in_session.againe == 0}">
                                        <div class="span6">
                                            <Button id="makeUpButtion" disabled="disabled" type="submit" class="btn">
                                                参加补考
                                            </Button>
                                        </div>
                                    </c:if>
                                </div>
                            </form>
                        </fieldset>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<input id="examState" type="hidden" value="${user_in_session.examState }"/>
<input id="makeUpState" type="hidden" value="${user_in_session.makeUpState }"/>
<script type="text/javascript">

    $(function () {
        $("#CheckBox").change(function () {
            if (this.checked) {
                enableButtion();
            } else {
                disableButtion();
            }
        });

// 			$("#examButtion").click(function(){
// 				console.debug($("#CheckBox").checked);
// 				if($("#CheckBox").is(":checked")){
        <%-- 					location.href = "<%=contextPath%>/exam?agree=1"; --%>
// 				}
// 			});
// 			$("#makeUpButtion").click(function(){
// 				if($("#CheckBox").checked){
        <%-- 					location.href = "<%=contextPath%>/exam?agree=1"; --%>
// 				}
// 			});
    });

    var enableButtion = function () {
        var examState = $("#examState").val();
        var makeUpState = $("#makeUpState").val();
        if (examState == 0) {
            $("#examButtion").removeAttr('disabled');
        } else if (examState == 3 && makeUpState == 0) {
            $("#makeUpButtion").removeAttr('disabled');
        }
    };

    var disableButtion = function () {
        $("#examButtion").attr('disabled', "true");
        $("#makeUpState").attr('disabled', "true");
    }
</script>
</body>
</html>